import {
	myRequest
} from './http.js'
import store from '../store';
//登录
export function employeelogin(config) {
	return myRequest({
		url: 'mini/auth',
		method: 'post',
		data: config,
		type: 'employee'
	})
}

//获取餐厅信息
export function getshop(config) {
	return myRequest({
		url: 'shops',
		method: 'get',
		data: config
	})
}

//订单提交
export function postorders(config) {
	return myRequest({
		url: 'employee/orders',
		method: 'post',
		data: config,
		type: 'employee'
	})
}

//获取订单
export function getorders(config) {
	return myRequest({
		url: 'employee/orders',
		method: 'get',
		data: config,
		type: 'employee'
	})
}
//获取一个订单
export function getorderone(config) {
	return myRequest({
		url: 'orders/' + config.id,
		method: 'get',
	})

}
//修改订单状态
export function orderstatus(config) {
	return myRequest({
		url: 'employee/orders/'+ config.id,
		method: 'put',
		data: config,
		type: 'employee'
	})

}
//修改单独菜品状态
export function itemstatus(config) {
	return myRequest({
		url: 'employee/order_items/'+ config.id,
		method: 'put',
		data: config,
		type: 'employee'
	})

}
//获取订单统计
export function getorderstatistics(config) {
	return myRequest({
		url: 'employee/order_items',
		method: 'get',
		data: config,
		type: 'employee'
	})
}

//修改密码
export function putpassword(config) {
	return myRequest({
		url:'employee/password/',
		method: 'put',
		data: config,
		type: 'employee'
	})
}
